﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dandan
{
    public class ModelsData
    {
        private static ModelsData order = null;//提供私有静态实例对象
        public static ModelsData GetData()
        {
            if (order == null)
            {
                order = new ModelsData();
            }
            return order;
        }

        public static void SetData(ModelsData Data)
        {
            order = Data;
        }

        public string status;
        public string code;
        public Model[] data;
    }

    public class Model
    {
        public projectsData project = new projectsData();
        public int count;
        public String id;
        public String title;
        public ModelCoverData cover;
        public String description;
        public string sn;
        public BrandClass brand;
        public string status;
        public int total_stock;
        public String sales;
        public int current_shop_count;
        public String shop_id;
        public List<NewModel> groups;
    }

    public class projectsData
    {
        public String id;
        public int count;
        public int discount;            //折扣1折是10,8.5折扣是85
        public float price;
        public String group_id;
        public String sn;
        public ModelCoverData cover;
        public String description;
        public int status;
        public BrandClass brand;
        public int total;
        public String title;
        public String tags;
        public int created_at;
        public int updated_at;
        public List<fieldsData> fields = new List<fieldsData>();
        public LinksData links;
       
    }

    public class NewModel
    {
        public String id;
        public String main_sn;
        public String sub_sn = "";
        public String title;
        public List<fieldsData> fields = new List<fieldsData>();
        public shopsData shop = new shopsData();
        public List<shopsData> shopinfo = new List<shopsData>();
    }

    public class fieldsData
    {

        public int id;
        public String title;
        public String name;
        public String value;
        public String validate_rule;
    }

    public class shopsData
    {
        public String shop_id;
        public String base_price;
        public String sale_price;
        public String discount_type = "percent";            //cash/percent  折扣类型
        public String discount_value;           //折扣值
        public String stock;                        //库存
    }

    public class FieldsData
    {
        // 定义一个SingletonTest类型的变量（不初始化，注意这里没有使用final关键字）
        private static FieldsData instance;

        // 定义一个静态的方法（调用时再初始化SingletonTest，但是多线程访问时，可能造成重复初始化问题）
        public static FieldsData getInstance()
        {
            if (instance == null)
                instance = new FieldsData();
            return instance;
        }

        public static void setInstance(FieldsData InfoData)
        {
            instance = InfoData;
        }

        public String status;
        public int code;
        public List<MouldsData> data = new List<MouldsData>();
    }
}
